<?php
	require "php/conn.php";
	/*if(!isset($_POST['sub'])){
		exit('非法操作');
	}
	
	
	
	$username=$_POST['username1'];
	$password=md5($_POST['password1']);
	$query="select * from login where username='$username' and password='$password'";
	$result=mysql_query($query);
	
	if(mysql_fetch_array($result)){
		header('location:index.html');//跳转
		setcookie('UserName',$username,time()+3600*24*7);
	}else{
		exit('登录失败<a href="javascript:history.back(-1);">返回</a>');
	}*/
	
	if(isset($_POST['name'])){
		$username=$_POST['name'];
		$password=md5($_POST['pass']);
	}else{
		echo '非法操作';
	}
	
	$query="select * from login where username='$username' and password='$password'";
	$result=mysql_query($query);
	
	if(mysql_fetch_array($result)){
		echo true;
	}else{
		echo false;
	}
?>